/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bit.entidade;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author marcelo
 */
@Entity
@Table(name = "processador")
@NamedQueries({@NamedQuery(name = "Processador.findAll", query = "SELECT p FROM Processador p"), @NamedQuery(name = "Processador.findById", query = "SELECT p FROM Processador p WHERE p.id = :id"), @NamedQuery(name = "Processador.findByNome", query = "SELECT p FROM Processador p WHERE p.nome = :nome"), @NamedQuery(name = "Processador.findByFabricante", query = "SELECT p FROM Processador p WHERE p.fabricante = :fabricante"), @NamedQuery(name = "Processador.findByClock", query = "SELECT p FROM Processador p WHERE p.clock = :clock")})
public class Processador implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Long id;
    @Column(name = "nome")
    private String nome;
    @Column(name = "fabricante")
    private String fabricante;
    @Column(name = "clock")
    private String clock;
    @OneToMany(mappedBy = "idProcessador")
    private Collection<Maquina> maquinaCollection;

    public Processador() {
    }

    public Processador(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getFabricante() {
        return fabricante;
    }

    public void setFabricante(String fabricante) {
        this.fabricante = fabricante;
    }

    public String getClock() {
        return clock;
    }

    public void setClock(String clock) {
        this.clock = clock;
    }

    public Collection<Maquina> getMaquinaCollection() {
        return maquinaCollection;
    }

    public void setMaquinaCollection(Collection<Maquina> maquinaCollection) {
        this.maquinaCollection = maquinaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Processador)) {
            return false;
        }
        Processador other = (Processador) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bit.entidade.Processador[id=" + id + "]";
    }

}
